Targetting
Stubs for Specific 32-Bit Platforms
Some of the
features of Microsoft RPC and the MIDL 3.0 compiler are platform-specific and
are intended for implementation in distributed applications that run only on
Windows NT 4.0 or a later version. Some features are supported in Windows NT
3.51 and Windows 95, as well as in later versions, but are not supported on
older 32-bit, or 16-bit platforms.
As a
safeguard, the MIDL 3.0 compiler generates macros that facilitate compatibility
checking during the C compilation phase. If the interface uses features
supported only on Windows NT 4.0, MIDL generates a TARGET_IS_NT40_OR_LATER
macro. If supported features require Windows NT 3.51 or Windows95, a
TARGET_IS_NT351_OR_WIN95_OR_LATER macro is generated. These macros, defined in
rpcndr.h, depend on the environment variables WINVER and _WIN32_WINNT and are
evaluated by the C/C++ compiler.
If, at
compile time, you get an error message indicating that you need a specific
platform to run this stub, first check to make sure you have not used a feature
not available on this platform. For example, the pipe type constructor,
the /Oif compiler option, and the user_marshal and wire_marshal
attributes are only available on Windows NT 4.0. Stubs using these features
will not run on earlier systems. The /Oic compiler switch is available
on NT. 3.51 and Windows 95, but is not available in earlier versions.
Also, the
technology needed to use OLE and OLE Automation data types (for example, BSTR
or STGMEDIUM) in remote operations is present only on NT 4.0. Therefore, you
cannot develop a custom interface that uses these data types in a remote
procedure call to run on earlier platforms.
If you know
that your target platform is correct for the features you are using, you need
to explicitly set the environment variables in your makefile.
{bmc bm4.MRB} To build for Windows NT 3.51 or Windows 95
Add this line
to your makefile:
CFLAGS = $(CFLAGS) -DWINVER=0x400
{bmc bm4.MRB} To build for Windows NT 4.0
Add this line
to your makefile:
CFLAGS = $(CFLAGS) -D_WIN32_WINNT=0x400
Note that
this target control is not in effect when you are building for MS-DOS, 16-bit
Windows, or Macintosh platforms.
See Also